package org.blade.personal.framework.components.metadata;

import java.io.Serializable;

import org.blade.personal.framework.dsl.express.Expression;
import org.blade.personal.framework.orm.base.Attribute;

/**
 * 类型元数据
 * 
 * @author ZHANG Blade
 *
 * @param <T>
 */
public class TypeMetaData<T> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8100518477435870853L;

	private Attribute<T> attr;
	private String clause;
	private String alise;
	private String sqlAlise;
	private String type;
	private Expression expr;

	/**
	 * 初始化方法
	 * @param attr 属性
	 * @param clause 子句
	 * @param alias 别名
	 * @param sqlAlise SQL别名
	 * @param type 类型
	 * @param expr 表达式
	 */
	public TypeMetaData(Attribute<T> attr, String clause, String alias,
			String sqlAlise, String type, Expression expr) {
		super();
		
		if( null == attr || null == alias || 
				 null == type ){
			throw new IllegalArgumentException(" 参数错误 ");
		}
		this.attr = attr;
		this.clause = clause;
		this.alise = alias;
		this.sqlAlise = sqlAlise;
		this.type = type;
		this.expr = expr;
	}

	public Attribute<T> getAttr() {
		return attr;
	}

	public String getClause() {
		return clause;
	}

	public String getAlise() {
		return alise;
	}

	public String getSqlAlise() {
		return sqlAlise;
	}

	public String getType() {
		return type;
	}

	public Expression getExpr() {
		return expr;
	}

}
